# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
for a in range(1,10):              ##生成一维数据行1~9
    for b in range(1,a+1):          ##生成一维数据行1~9
        print("{}*{}={:<5}".format(b,a,b*a),end='')
    print('')

print("="*90)

for j in range (9,0,-1):            ##生成一维数据列9~1
    for i in  range (1,j+1):        ##生成一维数据行1~9
        print("{}*{}={:<5}".format(i,j,i*j),end='')
    print('')
    

print("="*90)


for i in range (1,10):
    for k in range (1,i):
        print(end = "        ")
    for j in range (i,10):
            print("{}*{}={:<4}".format(i,j,i*j),end = "")
    print("")


print("="*90)

for i in range (9,0,-1):
    for k in range (1,i):
        print(end = "        ")
    for j in range (i,10):
            print("{}*{}={:<4}".format(i,j,i*j),end = "")
    print("")



print("="*90)
i=1
while i<=9:                       #控制行吗
    j=1
    while j<=i:
        print("{}*{}={:<3}".format(j,i,j*i),end="")
        j+=1
    print("")
    i+=1
    
print("="*90)


i = 9
while i >= 1:
    j = 1
    while j <= i:
        print("{}*{}={:<3}".format(j,i,j*i),end="")
        j += 1
    print("")
    i -= 1
print("="*90)   
i = 9
while i > 0:
    j = 1
    k = 8
    while k >= i:
        print('\t', end=(''))
        k -= 1
    while j <= i:
        print('{}*{}={}\t'.format(j, i, j * i), end=(''))
        j += 1
    print('')
    i -= 1
print("="*90) 
i = 1
while i <= 9:
    k = 8
    j = 1
    while k >= i:
        print('\t', end=(''))
        k -= 1
    while j <= i:
        print('{}*{}={}\t'.format(j,i,i*j),end=(""))
        j += 1
    print('')
    i += 1
print("="*90)
